<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>分成结算报表</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 20px; }
        table { border-collapse: collapse; width: 100%; margin-bottom: 20px; }
        th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
        th { background-color: #f2f2f2; text-align: center; }
        .footer { margin-top: 30px; }
        .section { margin-bottom: 30px; }
        .signature { margin-top: 50px; }
        .info-cell { vertical-align: top; }
    </style>
</head>
<body>
{if condition="input('type') eq 2"}
<h2 style="text-align: center;">渠道分成结算报表</h2>
{else /}
    <h2 style="text-align: center;">游戏分成结算报表</h2>
{/if}
<table>
    <tr>
        <th>分成项目</th>
        <th>合作方</th>
        <th>结算周期</th>
        <th>用户累计充值</th>
        {if condition="input('type') eq 1"}
            <th>渠道费率</th>
            <th>渠道费</th>
        {/if}
        <th>分成比例</th>
        <th>分成收入</th>
    </tr>
    {foreach name="list" item="vo"}
    <tr>
        <td>{:get_game_filed($vo['gid'],'name')}</td>
        <td>{if condition="input('type') eq 2"}{:get_channel_name($vo['cid'])}{else /}{:get_cp_name($vo['cp_id'])}{/if}</td>
        <td>{$vo['date_month']}</td>
        <td>{$vo['amount']}</td>
        {if condition="input('type') eq 2"}
        {else /}
        {/if}
        {if condition="input('type') eq 2"}
            <td>{:round($cpData['fee'],2)}</td>
            <td>{:round($vo['c_fencheng'],2)}</td>
        {else /}
            <td>{:get_game_filed($vo['gid'],'cfencheng')}%</td>
            <td>{:round($vo['g_fee'],2)}</td>
            <td>{:get_game_filed($vo['gid'],'gfencheng')}%</td>
            <td>{:round($vo['g_fencheng'],2)}</td>
        {/if}
    </tr>
    {/foreach}

    <tr>
        <td><strong>合计</strong></td>
        <td></td>
        <td></td>
        <td><strong>{$sumData['totalAmount']}</strong></td>
        {if condition="input('type') eq 1"}
        <td></td>
        {/if}

        {if condition="input('type') eq 1"}
            <td><strong>{$sumData['totalFee']}</strong></td>
            <td></td>
            <td><strong>{$sumData['totalIncome']}</strong></td>
        {else /}
            <td></td>
            <td><strong>{$sumData['totalCIncome']}</strong></td>
        {/if}

    </tr>

    <!-- 新增的联系信息和发票信息行 -->
    <tr>
    {if condition="input('type') eq 2"}
        <td class="info-cell" colspan="3">
            <strong>付款方：</strong><br>
        </td>
        <td class="info-cell" colspan="3">
            <strong>收款方：</strong><br>
        </td>
    {else /}
        <td class="info-cell" colspan="6">
            <strong>付款方：</strong><br>
        </td>
        <td class="info-cell" colspan="6">
            <strong>收款方：</strong><br>
        </td>
    {/if}

    </tr>
    <tr>
    {if condition="input('type') eq 2"}
        <td class="info-cell" colspan="3">
            发票抬头：艾七（上海）科技有限公司<br>
            发票内容:信息系统服务*信息服务费<br>
            纳税识别号：91310120MA7F0F8C3L<br>
            银行账号：31050161364000007664<br>
            开户银行：中国建设银行股份有限公司上海浦东分行<br>
            注册电话：18811546788<br>
            注册地址：上海市闵行区虹梅南路1755号1幢1层<br>
            发票类型: 6%增值税专用发票<br>
        </td>

        <td class="info-cell"colspan="3">
            开户名称：{$cpData['nickname']}<br>
            开户银行：{$cpData['bank']}<br>
            银行账号：{$cpData['bank_num']}<br>
            联系人：{$cpData['nickname']}<br>
            联系电话：{$cpData['mobile']}<br>
            收件地址：{$cpData['address']}<br>
        </td>
    {else /}
        <td class="info-cell" colspan="6">
            发票抬头：艾七（上海）科技有限公司<br>
            发票内容:信息系统服务*信息服务费<br>
            纳税识别号：91310120MA7F0F8C3L<br>
            银行账号：31050161364000007664<br>
            开户银行：中国建设银行股份有限公司上海浦东分行<br>
            注册电话：18811546788<br>
            注册地址：上海市闵行区虹梅南路1755号1幢1层<br>
            发票类型: 6%增值税专用发票<br>
        </td>

        <td class="info-cell"colspan="6">
            开户名称：{$cpData['company']}<br>
            开户银行：{$cpData['bank']}<br>
            银行账号：{$cpData['bank_num']}<br>
            联系人：{$cpData['contacts']}<br>
            联系电话：{$cpData['phone']}<br>
            收件地址：{$cpData['company_address']}<br>
        </td>
    {/if}
{/*        <td colspan="5" class="info-cell">*/}
{/*            <strong>盖章处：</strong><br>*/}
{/*        </td>*/}
    </tr>


</table>
</body>
</html>